BaseExceptionFilter from @nestjs/core implements the built-in exception handling. Extend it, add your logic, then call super.catch() to let NestJS handle the response. Registration requires passing the HttpAdapterHost because BaseExceptionFilter needs it to access the underlying HTTP adapter.
Extend BaseExceptionFilter when you only need to add side effects (logging, metrics) without changing the response format.
Write a full custom filter when you need complete control over the response body shape.
BaseExceptionFilter needs HttpAdapterHost to function — always inject it via the factory.
super.catch() must be called for the default response serialization to work.
This is the least invasive way to add observability without breaking the default NestJS error format.